package com.ge.util.commons.clouds.test;

import com.ge.util.commons.clouds.Client;
import com.ge.util.commons.clouds.CloudsException;
import com.ge.util.commons.clouds.client.FullWorkingAsyn;
import com.ge.util.commons.clouds.client.FullWorkingSyn;
import com.ge.util.commons.clouds.client.MasterSlave;

public class Client01 {

	public static void main(String[] args) throws InterruptedException, CloudsException {
		Client mClient = new FullWorkingAsyn("F:\\Hanyu\\Code\\AdslSession\\src\\com\\ge\\util\\commons\\clouds\\clouds.ini");
		
		mClient.addCodec(new StringCodec());
		//mClient.addCodec(new ZipCodec());
		//mClient.addCodec(new RarCodec());
		
		long nStart = System.currentTimeMillis();
		for (int i=0; i<1000; i++) {
			
			Student m = new Student();
			m.strName = "Name" + String.valueOf(i);
			m.strAddress = "Address" + String.valueOf(i);
			m.strMemo = "Memo" + String.valueOf(i);
			
			try {
				Student m2 = (Student)mClient.doFun("2", m);
			} catch (CloudsException e) {
				//e.printStackTrace();
			}	
			//System.out.println(m2);
			Thread.sleep(10);
		}
		long nEnd = System.currentTimeMillis();
		System.out.println(nEnd - nStart);
		mClient.close();
	}

}
